//Design By Do Trung --- Email : trungqn19852003@yahoo.com
//Ngày Design :5/4/2011 5:00:32 PM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Linq;
using System.Collections.Generic;
 

	/// <summary>
	/// </summary>
	public class TaiNguyen_BA
	{
		public TaiNguyen_BA() {}
#region 'Variables And Properties'
		 private int int_IdTaiNguyen ;
		 public int IdTaiNguyen
			{
			 get 	
				{
					 return this.int_IdTaiNguyen;
				}
			 set 	
				{
					int_IdTaiNguyen=value;
				}
			}
		 private int int_IdChuyenMuc ;
		 public int IdChuyenMuc
			{
			 get 	
				{
					 return this.int_IdChuyenMuc;
				}
			 set 	
				{
					int_IdChuyenMuc=value;
				}
			}
		 private int int_IdThuVien ;
		 public int IdThuVien
			{
			 get 	
				{
					 return this.int_IdThuVien;
				}
			 set 	
				{
					int_IdThuVien=value;
				}
			}
		 private string string_TenDangNhap ;
		 public string TenDangNhap
			{
			 get 	
				{
					 return this.string_TenDangNhap;
				}
			 set 	
				{
					string_TenDangNhap=value;
				}
			}
		 private string string_TenTapTin ;
		 public string TenTapTin
			{
			 get 	
				{
					 return this.string_TenTapTin;
				}
			 set 	
				{
					string_TenTapTin=value;
				}
			}
		 private string string_DuongDanTapTin ;
		 public string DuongDanTapTin
			{
			 get 	
				{
					 return this.string_DuongDanTapTin;
				}
			 set 	
				{
					string_DuongDanTapTin=value;
				}
			}
		 private string string_DungLuongTapTin ;
		 public string DungLuongTapTin
			{
			 get 	
				{
					 return this.string_DungLuongTapTin;
				}
			 set 	
				{
					string_DungLuongTapTin=value;
				}
			}
		 private string string_MoTaTapTin ;
		 public string MoTaTapTin
			{
			 get 	
				{
					 return this.string_MoTaTapTin;
				}
			 set 	
				{
					string_MoTaTapTin=value;
				}
			}
		 private string string_HinhAnhMoTa ;
		 public string HinhAnhMoTa
			{
			 get 	
				{
					 return this.string_HinhAnhMoTa;
				}
			 set 	
				{
					string_HinhAnhMoTa=value;
				}
			}
		 private string string_SoLuotTaiVe ;
		 public string SoLuotTaiVe
			{
			 get 	
				{
					 return this.string_SoLuotTaiVe;
				}
			 set 	
				{
					string_SoLuotTaiVe=value;
				}
			}
		 private bool bool_TrangThai ;
		 public bool TrangThai
			{
			 get 	
				{
					 return this.bool_TrangThai;
				}
			 set 	
				{
					bool_TrangThai=value;
				}
			}
#endregion

		/// <summary>
		/// Inserts a record into the TaiNguyen table.
		/// <summary>
		/// <param name="IdTaiNguyen"></param>
		/// <param name="IdChuyenMuc"></param>
		/// <param name="IdThuVien"></param>
		/// <param name="TenDangNhap"></param>
		/// <param name="TenTapTin"></param>
		/// <param name="DuongDanTapTin"></param>
		/// <param name="DungLuongTapTin"></param>
		/// <param name="MoTaTapTin"></param>
		/// <param name="HinhAnhMoTa"></param>
		/// <param name="SoLuotTaiVe"></param>
		/// <param name="TrangThai"></param>
		/// <returns></returns>
		public bool Insert(SqlConnection SqlCnn)
		{
			bool boolInsert = false ;
			TaiNguyen_DA clsDA_TaiNguyen = new TaiNguyen_DA();
			clsDA_TaiNguyen.IdTaiNguyen=int_IdTaiNguyen;
			clsDA_TaiNguyen.IdChuyenMuc=int_IdChuyenMuc;
			clsDA_TaiNguyen.IdThuVien=int_IdThuVien;
			clsDA_TaiNguyen.TenDangNhap=string_TenDangNhap;
			clsDA_TaiNguyen.TenTapTin=string_TenTapTin;
			clsDA_TaiNguyen.DuongDanTapTin=string_DuongDanTapTin;
			clsDA_TaiNguyen.DungLuongTapTin=string_DungLuongTapTin;
			clsDA_TaiNguyen.MoTaTapTin=string_MoTaTapTin;
			clsDA_TaiNguyen.HinhAnhMoTa=string_HinhAnhMoTa;
			clsDA_TaiNguyen.SoLuotTaiVe=string_SoLuotTaiVe;
			clsDA_TaiNguyen.TrangThai=bool_TrangThai;

			boolInsert = clsDA_TaiNguyen.Insert(SqlCnn);
			clsDA_TaiNguyen = null ;
			return boolInsert;
		}

		/// <summary>
		/// Selects a single record from the TaiNguyen table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable Select(SqlConnection SqlCnn)
		{
			TaiNguyen_DA clsDA_TaiNguyen = new TaiNguyen_DA();
			DataTable dt = new DataTable();
			dt=clsDA_TaiNguyen.Select(SqlCnn);
			clsDA_TaiNguyen= null ;
			return dt;
		}

		/// <summary>
		/// Selects a single record from the TaiNguyen table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable SelectPrimaryKey(SqlConnection SqlCnn)
		{
			TaiNguyen_DA clsDA_TaiNguyen = new TaiNguyen_DA();
			DataTable dt = new DataTable();
			clsDA_TaiNguyen.IdTaiNguyen=int_IdTaiNguyen;

			dt=clsDA_TaiNguyen.SelectPrimaryKey(SqlCnn);
			clsDA_TaiNguyen= null;
			return dt;
			}

		/// <summary>
		/// Updates a record in the TaiNguyen table.
		/// <summary>
		/// <param name="IdTaiNguyen"></param>
		/// <param name="IdChuyenMuc"></param>
		/// <param name="IdThuVien"></param>
		/// <param name="TenDangNhap"></param>
		/// <param name="TenTapTin"></param>
		/// <param name="DuongDanTapTin"></param>
		/// <param name="DungLuongTapTin"></param>
		/// <param name="MoTaTapTin"></param>
		/// <param name="HinhAnhMoTa"></param>
		/// <param name="SoLuotTaiVe"></param>
		/// <param name="TrangThai"></param>
		public bool Update(SqlConnection SqlCnn)
		{
			bool boolUpdate = false ;
			TaiNguyen_DA clsDA_TaiNguyen = new TaiNguyen_DA();
			clsDA_TaiNguyen.IdTaiNguyen=int_IdTaiNguyen;
			clsDA_TaiNguyen.IdChuyenMuc=int_IdChuyenMuc;
			clsDA_TaiNguyen.IdThuVien=int_IdThuVien;
			clsDA_TaiNguyen.TenDangNhap=string_TenDangNhap;
			clsDA_TaiNguyen.TenTapTin=string_TenTapTin;
			clsDA_TaiNguyen.DuongDanTapTin=string_DuongDanTapTin;
			clsDA_TaiNguyen.DungLuongTapTin=string_DungLuongTapTin;
			clsDA_TaiNguyen.MoTaTapTin=string_MoTaTapTin;
			clsDA_TaiNguyen.HinhAnhMoTa=string_HinhAnhMoTa;
			clsDA_TaiNguyen.SoLuotTaiVe=string_SoLuotTaiVe;
			clsDA_TaiNguyen.TrangThai=bool_TrangThai;

			boolUpdate = clsDA_TaiNguyen.Update(SqlCnn);
			clsDA_TaiNguyen = null ;
			return boolUpdate;
		}

		/// <summary>
		/// Deletes a record from the TaiNguyen table by a composite primary key.
		/// <summary>
		public bool Delete(SqlConnection SqlCnn)
		{
			bool boolDelete = false ;
			TaiNguyen_DA clsDA_TaiNguyen = new TaiNguyen_DA();
			clsDA_TaiNguyen.IdTaiNguyen=int_IdTaiNguyen;

			boolDelete = clsDA_TaiNguyen.Delete(SqlCnn);
			clsDA_TaiNguyen = null ;
			return boolDelete;
		}
	}

